﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LMS.SMSH.WEB
{
    public partial class AdminTeacherAdd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                
            }
        }

        /// <summary>
        /// 将教师信息写入数据库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOK_Click(object sender, EventArgs e)
        {
            TB_teacher teacher = new TB_teacher();
            teacher.teacherId = txtTeacherID.Text.Trim();
            teacher.teacherName = txtTeacherName.Text.Trim();
            teacher.teacherPwd = txtPwd1.Text.Trim();
            LMSDataContext.GetLMSDB.TB_teacher.InsertOnSubmit(teacher);
            LMSDataContext.GetLMSDB.SubmitChanges();
            ClientScript.RegisterStartupScript(this.GetType(), "", "alert('保存数据成功!')", true);
        }
    }
}